<% sources[sid].vector_layers.forEach(function (layer) { %>

  var layerColor = '#' + randomColor(lightColors);

  map.addLayer({
    'id': '<%= layer.id %>-polygons',
    'type': 'fill',
    'source': '<%= sid %>',
    'source-layer': '<%= layer.id %>',
    'filter': ["==", "$type", "Polygon"],
    'layout': {},
    'paint': {
      'fill-opacity': 0.1,
      'fill-color': layerColor
    }
  });

  map.addLayer({
    'id': '<%= layer.id %>-polygons-outline',
    'type': 'line',
    'source': '<%= sid %>',
    'source-layer': '<%= layer.id %>',
    'filter': ["==", "$type", "Polygon"],
    'layout': {
      'line-join': 'round',
      'line-cap': 'round'
    },
    'paint': {
      'line-color': layerColor,
      'line-width': 1,
      'line-opacity': 0.75
    }
  });

  map.addLayer({
    'id': '<%= layer.id %>-lines',
    'type': 'line',
    'source': '<%= sid %>',
    'source-layer': '<%= layer.id %>',
    'filter': ["==", "$type", "LineString"],
    'layout': {
      'line-join': 'round',
      'line-cap': 'round'
    },
    'paint': {
      'line-color': layerColor,
      'line-width': 1,
      'line-opacity': 0.75
    }
  });

  map.addLayer({
    'id': '<%= layer.id %>-pts',
    'type': 'circle',
    'source': '<%= sid %>',
    'source-layer': '<%= layer.id %>',
    'filter': ["==", "$type", "Point"],
    'paint': {
      'circle-color': layerColor,
      'circle-radius': 2.5,
      'circle-opacity': 0.75
    }
  });

  layers.polygons.push('<%= layer.id %>-polygons');
  layers.polygons.push('<%= layer.id %>-polygons-outline');
  layers.lines.push('<%= layer.id %>-lines');
  layers.pts.push('<%= layer.id %>-pts');

<% }); %>
